feat(opencode): skill parity — generate the tree from canonical ctx skills - #160
Conversation
a41f087 to
b6bf560
Compare
…kills Align OpenCode with the Copilot CLI model (issue ActiveMemory#158): hack/sync-opencode-skills.sh derives each enrolled skill from internal/assets/claude/skills/<name>/SKILL.md with the Claude-specific allowed-tools frontmatter key stripped. Opt-in by directory presence; wired into make build; check-opencode-skills gates make audit. Enrolls 17 skills: the existing 10 hand-written ones (terse variants replaced by canonical bodies) plus the Design Before Coding planning arc (ctx-brainstorm, ctx-plan, ctx-spec, ctx-task-out, ctx-implement) and the capture pair (ctx-task-add, ctx-decision-add). No Go changes: the embed glob, agent.OpenCodeSkills(), and deploySkills() walk whatever directories exist. docs/home/opencode.md slash-command section updated (site/ regen tracked in TASKS). Closes ActiveMemory#158 Spec: specs/opencode-skill-parity.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
Only the opencode page and search index are committed: the local zensical 0.0.51 rebuild also churns 100+ unrelated pages with HTML-entity encoding differences (&ActiveMemory#39; vs ') from underlying library drift; that churn is excluded to keep this PR isolated. Spec: specs/opencode-skill-parity.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
Spec: specs/opencode-skill-parity.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
b6bf560 to
9cbc141
Compare
|
@omergk28 looking mostly good; here are my comments: 1. Canonical bodies introduce seven dangling slash-command references in the pre-existing ten
The closure claim here is scoped to the planning arc, and it holds — verified Cheapest meaningful fix: enroll 2. Parity test mirrors the transform's over-reach, so it can't catch it
Today the tree is safe — every Nit3. Gate restore can leave an untracked generated SKILL.md behind
If a skill directory is committed without a |
…over-reach Review findings on ActiveMemory#160: the canonical bodies introduced dangling slash-command references in the pre-existing ten. Enroll ctx-learning-add and ctx-convention-add — synced wrap-up, handover, and kb-note route capture through them, and the capture-pair rationale that enrolled task-add/decision-add applies verbatim. The remaining five (/ctx-commit, /ctx-reflect, /ctx-digest, /ctx-history, /ctx-journal-enrich-all) are recorded in the spec as an accepted gap, closed by the queued mirror-sync follow-up branch. Add TestAllowedToolsConfinedToFrontmatter: the sed transform deletes every column-0 allowed-tools: line and the parity test replicates the same transform, so a canonical body gaining one outside frontmatter would be corrupted silently in every generated tree. The guard turns that into a red test. The regenerated search.json indexes docs/home/codex.md (on main since PR ActiveMemory#163, which landed without its generated site page), so site/home/codex/index.html ships alongside — an index entry without its page would put dead codex results in site search. Spec: specs/opencode-skill-parity.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
|
Thanks for the review @josealekhine — addressed in f3adbc8:
One rider: the regenerated |
|
Landed. |
Review findings from ActiveMemory#171. P2: check-pi-skills could exit 0 after its sync script failed. The recipe's &&-chain skips the diff when the backup copy or the sync script fails, but the semicolon-separated cleanup still ran — so the gate deleted its backup, printed "Pi skills are in sync." and returned success. Worse here than elsewhere because sync-pi-skills.sh removes the tree before copying its replacement. Chain the cleanup and the success message with && so a failure returns nonzero and retains the backup for recovery. The three sibling gates (copilot, codex, opencode) carry the identical recipe shape, so all four are fixed together per the reviewer guidance on ActiveMemory#160 not to let them diverge. P3: declare sync-pi-skills: sync-opencode-skills. As sibling prerequisites of build their written order does not serialize them under make -j, so Pi could copy a SKILL.md the OpenCode generator had truncated. The dependency also makes a standalone make sync-pi-skills refresh its source first. Follow-ups from the same review: port the OpenCode fresh-deploy and stale-reference assertions to Pi's committed tests, and update the Pi spec and docs for the generated 50-skill set and its references files. Spec: specs/opencode-mirror-sync.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
feat(opencode): skill parity — generate the tree from canonical ctx skills
Branch:
feat/158-opencode-skill-parity→main· Closes #158Commits:
0be1d23c,930325e2,9cbc1419,f3adbc8f· Spec:specs/opencode-skill-parity.mdWhat
Aligns OpenCode with the Copilot CLI model: the skill tree is
generated from
internal/assets/claude/skills/at build time.hack/sync-opencode-skills.sh— sibling of the Copilot script,same contract: opt-in by directory presence,
allowed-tools:frontmatter strip, OpenCode-only skills untouched. shellcheck-clean.
sync-opencode-skillsruns inmake build;check-opencode-skillsgatesmake audit(fails on staleness andrestores state, mirroring the Copilot gate).
replaced by canonical bodies) + the Design Before Coding planning
arc (
ctx-brainstorm,ctx-plan,ctx-spec,ctx-task-out,ctx-implement) + capture pair (ctx-task-add,ctx-decision-add). Canonical names, 1:1 with the Claude tree.TestSyncedSkillParity(
internal/assets/read/skill/parity_test.go): asserts everysynced skill in BOTH generated trees (OpenCode + Copilot CLI) is
byte-identical to its Claude source minus
allowed-tools:lines.This moves the sync contract into
go test, so CI now enforcesit — previously only
make auditon developer machines did.Verifies 52 synced skills, 14 Copilot tool-only exempt.
agent.OpenCodeSkills(), anddeploySkills()already walk whatever directories exist.docs/home/opencode.mdslash-command section lists the fullsynced set (relative recipe link per docs conventions);
site/regenerated for that page +
search.jsononly (see below).Verification
make auditfully green (run on main + this + the siblinghack-portability fix, i.e. post-merge state), including the new
check-opencode-skillsgate.check-opencode-skillsfails and restores state.ctx setup opencode --writein afresh temp repo → all 17 skills deployed, deployed content
byte-identical to embedded source.
TestSkillFrontmattercovers the 7 new dirs automatically.Decisions / notes for review
terseness was truncated reference material, so canonical bodies
replace it. This also drops a couple of genuinely OpenCode-specific
lines (e.g. ctx-status's "slash command takes no arguments" note) —
judged not worth a divergent transform; revisit in the sync script
if OpenCode-specific adaptation is ever needed.
make sitewith the exactly-pinned zensical 0.0.51 churns 100+unrelated pages with HTML-entity encoding differences (underlying
library drift; captured as a LEARNING). Excluded to keep the PR
isolated.
fix/hack-script-portabilityshould merge first somake auditruns for macOS reviewers; this PR does not depend onit for CI.